package com.ccrfid.rmc6.entity.business.rollcall2;

import com.fasterxml.jackson.annotation.JsonFormat;

import javax.persistence.*;
import java.sql.Time;

@Entity
@Table(name = "rc_schedule")
public class RcScheduleEntity {
    private Long id;
    private Time scheduleTime;
    private Long orgGroupId;
    private String orgGroupName;
    private Long locationGroupId;
    private String locationGroupName;
    private Integer enabled;
    private String remark;

    @Id
    @Column(name = "id", nullable = false)
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    @Basic
    @Column(name = "schedule_time", nullable = false)
    @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "HH:mm:ss")
    public Time getScheduleTime() {
        return scheduleTime;
    }

    public void setScheduleTime(Time scheduleTime) {
        this.scheduleTime = scheduleTime;
    }

    @Basic
    @Column(name = "org_group_id", nullable = false)
    public Long getOrgGroupId() {
        return orgGroupId;
    }

    public void setOrgGroupId(Long orgGroupId) {
        this.orgGroupId = orgGroupId;
    }

    @Basic
    @Column(name = "org_group_name", length = 45)
    public String getOrgGroupName() {
        return orgGroupName;
    }

    public void setOrgGroupName(String orgGroupName) {
        this.orgGroupName = orgGroupName;
    }

    @Basic
    @Column(name = "location_group_id", nullable = false)
    public Long getLocationGroupId() {
        return locationGroupId;
    }

    public void setLocationGroupId(Long locationGroupId) {
        this.locationGroupId = locationGroupId;
    }

    @Basic
    @Column(name = "location_group_name", length = 45)
    public String getLocationGroupName() {
        return locationGroupName;
    }

    public void setLocationGroupName(String locationGroupName) {
        this.locationGroupName = locationGroupName;
    }

    @Basic
    @Column(name = "is_enabled", nullable = false)
    public Integer getEnabled() {
        return enabled;
    }

    public void setEnabled(Integer enabled) {
        this.enabled = enabled;
    }

    @Basic
    @Column(name = "remark", length = 255)
    public String getRemark() {
        return remark;
    }

    public void setRemark(String remark) {
        this.remark = remark;
    }

    @Override
    public String toString() {
        return "RcScheduleEntity{" +
                "id=" + id +
                ", scheduleTime=" + scheduleTime +
                ", orgGroupId=" + orgGroupId +
                ", orgGroupName='" + orgGroupName + '\'' +
                ", locationGroupId=" + locationGroupId +
                ", locationGroupName='" + locationGroupName + '\'' +
                ", enabled=" + enabled +
                ", remark='" + remark + '\'' +
                '}';
    }
}
